package com.power.flowable.api;

import com.plf.common.domain.ResponseDTO;
import com.power.flowable.model.pageinfo.ApplyqueryPageInfo;
import com.power.flowable.model.pageinfo.ProcessStatisticsPageInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = "sfflow-svr", contextId = "sfflow-svr", path = "/sfflow-svr")
@RestController
public interface IProcessStatisticsQueryFeign {

	/**
	 * 查询进行中/已完成的流程列表
	 * @param pageInfo
	 * @return
	 */
	@PostMapping("/processStatisticsQuery/findList")
	ResponseDTO list(@RequestBody ProcessStatisticsPageInfo pageInfo);

	/**
	 * 统计本月流程任务的完成情况
	 * @return List<{state: 已终止 | 未完成 | 已完成， total: 计数}>
	 */
	@PostMapping("/processStatisticsQuery/monthProHandling")
	ResponseDTO monthProHandling();

	/**
	 * 当月申请前十名流程
	 * @return
	 */
	@PostMapping("/processStatisticsQuery/monthTopTenApplicants")
	ResponseDTO monthTopTenApplicants();

	/**
	 * 近三十天每日申请量
	 * @return
	 */
	@PostMapping("/processStatisticsQuery/dailyApplicationVolume")
	ResponseDTO dailyApplicationVolume();

	/**
	 * 查询各环节的操作员
	 * @param key
	 * @return
	 */
	@PostMapping("/processStatisticsQuery/queryTaskUsers")
	ResponseDTO queryTaskUsers(@RequestParam("key") String key, @RequestParam("sectionid") String sectionid);

	/**
	 * 申请查询
	 * @param pageInfo
	 * @return
	 */
	@PostMapping("/processStatisticsQuery/applyQuery")
	ResponseDTO applyQuery(@RequestBody ApplyqueryPageInfo pageInfo);

	/**
	 * 申请查询导出excel
	 */
	@PostMapping("/flow/applyQueryOutput")
	feign.Response applyQueryOutput(@RequestBody Map<String, Object> body);

}
